<?php 
if(!defined('ADMIN')){
	exit('Access Denied');
}

?>
<form id="pagerForm" method="post" action="#rel#">
	<input type="hidden" name="pageNum" value="<?=$page?>" />
	<input type="hidden" name="numPerPage" value="<?=$pagesize?>" />
	<input type="hidden" name="orderField" value="<?=$orderField?>" />
	<input type="hidden" name="orderDirection" value="<?=$orderDirection?>" />
</form>
<div class="pageHeader">
	<form rel="pagerForm" onsubmit="return navTabSearch(this);" action="<?=u(MOD,'list',array('q'=>$q,'parent_id'=>$parent_id))?>" method="post">
	<div class="searchBar">
		<ul class="searchContent">
			<li>
				<label>帐号名称：</label>
				<input type="text" name="q" value="<?=$q?>" />
                
                <button type="submit">查询</button>
			</li>
		</ul>

	</div>
	</form>
</div>
<div class="pageContent">
	<div class="panelBar">
		<ul class="toolBar">
			<li><a class="add" href="<?=u(MOD,'addedi')?>" target="dialog"><span>新增管理员</span></a></li>
			<li><a title="确实要删除这些记录吗?" target="selectedTodo" rel="ids[]" href="<?=u(MOD,'del')?>" class="delete"><span>批量删除</span></a></li>
			<li><a class="edit" href="<?=u(MOD,'addedi',array('id'=>'{id}'))?>" target="dialog" warn="请选择一条记录"><span>修改</span></a></li>
			<li class="line">line</li>
		</ul>
	</div>

                    <table class="table" width="100%" layoutH="138">
                    <thead>
                    <tr>
                      <th width="3%"><input type="checkbox" onClick="checkAll(this,'ids[]')" /></th>
					  <th width="">账号</th>
                      <th width="150px">上次登录时间</th>
                      <th width="8%">上次登录IP</th>
                      <th width="8%">登录次数</th>
                      <th width="8%">登录ip</th>
                      <th width="8%">权限组</th>
                      <th width="150px">添加时间</th>
                      <th width="8%">操作</th>
                    </tr>
	           	</thead>
                <tbody>                    
					<?php foreach ($row as $r){?>
					  <tr target="id" rel="<?=$r["id"]?>">
                        <td class="center"><input <?php if($r['id']==1){?> title="默认管理员不准删除" disabled<?php }?> type='checkbox' name='ids[]' value='<?=$r["id"]?>' id='content_<?=$r["id"]?>' /></td>
                        <td><?=$r["adminname"]?></td>
                        <td class="center"><? if($r[lastlogintime]>0){ echo date('Y-m-d H:i:s',$r["lastlogintime"]);}?></td>
                        <td><?=$r["lastloginip"]?></td>
                        <td class="center"><?=$r["loginnum"]?></td>
                        <td><?=$r["loginip"]?></td>
                        <td class="center"><?=$role_arr[$r["role"]]?></td>
                        <td class="center"><?=date('Y-m-d H:i:s',$r["addtime"])?></td>
        				<td class="center">
                        <?php if($_SESSION['EZ_Admin']['id']==1 || $r['id']!=1){?>
                            <?php if($r['id']!=1){?> 
        					<a title="删除" target="ajaxTodo" href="<?=u(MOD,'del',array('id'=>$r['id']))?>" class="btnDel">删除</a>
                            <?php }?> 
        					<a title="编辑" target="dialog" href="<?=u(MOD,'addedi',array('id'=>$r['id']))?>" class="btnEdit">编辑</a>
                        <?php }?>
        				</td>
					  </tr>
					<?php }?>
                     </tbody>
                  </table>
	<div class="panelBar">
		<div class="pages">
			<span>显示</span>
			<select class="combox" name="numPerPage" onchange="navTabPageBreak({numPerPage:this.value})" id="PageSize">
				<option value="20" <? if($pagesize==20){ echo 'selected="true"';}?>>20</option>
				<option value="50" <? if($pagesize==50){ echo 'selected="true"';}?>>50</option>
				<option value="100" <? if($pagesize==100){ echo 'selected="true"';}?>>100</option>
				<option value="200" <? if($pagesize==200){ echo 'selected="true"';}?>>200</option>
			</select>
			<span>条，共<?php echo $total;?>条</span>
		</div>
		
		<div class="pagination" targetType="navTab" totalCount="<?php echo $total;?>" numPerPage="<?=$pagesize?>" pageNumShown="10" currentPage="<?=$page?>"></div>

	</div>
</div>    
